<?php

/**
 * Acesso
 *  
 * @author diego
 * @version 
 */

require_once 'Zend/Db/Table/Abstract.php';

class Acl_Acesso extends Zend_Db_Table_Abstract {
	/**
	 * The default table name 
	 */
	protected $_name = 'acl_acesso';

	protected $_referenceMap    = array(
        'Perfil' => array(
            'columns'           => array('id_perfil'),
            'refTableClass'     => 'Perfis',
            'refColumns'        => array('id'),
            'onDelete'          => self::CASCADE,
            'onUpdate'          => self::RESTRICT
        ), 
        'Areas' => array(
            'columns'           => array('id_recurso'),
            'refTableClass'     => 'Recursos',
            'refColumns'        => array('id'),
            'onDelete'          => self::CASCADE,
            'onUpdate'          => self::RESTRICT
        )
     );   
     
     public function findByPerfil($id) {
     	return $this->fetchAll ( $this->getAdapter ()->quoteInto ( 'id_perfil = ?', $id ));
     }
        
}
